package com.cavedroid;

public class DualCave extends Cave {
	
	@Override
	protected void initObstacles() {
		obstacles = new DualObstacles(cube);
	}
	
	@Override
	public void init() {
		initialLoopRadius = 12;
		super.init();
	}
	
	@Override
	public float getDistanceFromTunnel() {
		Float[] center = tunnelCenter.get(1);
		return center[2] - Geometry.distance2(cameraX, cameraY, center[X_COORD], center[Y_COORD]);
	}
	
	@Override
	public boolean collectibleCollision() {
		if (super.collectibleCollision()) {
			if (Math.abs(cameraX - collectible.xPos) < 2*Collectible.SIZE) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	protected void calculateAmplitudes() {
		tunnelAmplitude = (float)(Math.random()*2 - 1)*tunnelAmpDiff*spiralLoopCount/tunnelWavelength;
		tunnelHorizontalAmplitude = (float)(Math.random()*2 - 1)*tunnelAmpDiff*spiralLoopCount/tunnelWavelength;
	}
}
